package app.common.utils.cjt.ao;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.stream.Collectors;

/**
 * 销货单批量删除接口
 * @author feizns
 * @since 2023/05/11
 */
@NoArgsConstructor
@Data
public class SaleDeliveryBatchDeleteAo {

    /**
     * dtos
     */
    private List<Dtos> dtos;

    /**
     * Dtos
     */
    @NoArgsConstructor
    @Data
    @AllArgsConstructor
    public static class Dtos {
        /**
         * externalCode
         */
        private String externalCode;
    }

    /**
     * @param externalCodes 外部代码
     * @return {@link SaleDeliveryBatchDeleteAo}
     */
    public static SaleDeliveryBatchDeleteAo of(List<String> externalCodes) {
        SaleDeliveryBatchDeleteAo ao = new SaleDeliveryBatchDeleteAo();
        ao.setDtos(externalCodes.stream().map(Dtos::new).collect(Collectors.toList()));
        return ao;
    }

}
